package org.example.login2;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import java.io.IOException;

import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

@WebServlet("/deleteStudent")
public class DeleteStudentServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        InMemoryStudentDatabase.removeStudent(id);
        resp.sendRedirect("studentList");
    }
}
